If a boolean expression doesn’t change the evaluation of the condition, then it is entirely unnecessary, and can be removed. If it is gratuitous
because it does not match the programmer’s intent, then it’s a bug and the expression should be fixed.
Noncompliant code example
IF BAR = 4
* Noncompliant: due to the nesting IF statement, we know that BAR = 4 here and so
* what's the point of testing again that BAR = 4 ?
IF FOO = "a" AND BAR = 4
DISPLAY "something"
END-IF.
...
END-IF
* Noncompliant: by definition BAR is greater than 0 if BAR = 4,
* so the condition BAR > 0 should be removed
IF BAR = 4 AND > 0 THEN DISPLAY "something".
Compliant solution
IF BAR = 4
IF FOO = "a"
DISPLAY "something"
END-IF.
...
END-IF
IF BAR = 4 THEN DISPLAY "something".